<?php

namespace app\company\validate;


class LoginValidate extends BaseValidate
{

    public function __construct()
    {
        $rule = [
            'user_name' => 'require',
            'mobile'    => 'require|mobile',
            'password'  => 'require|max:30',
            "code"      => "require",
            "code_id"   => "require",
        ];

        $message = [
            'user_name.require' => '用户名不能为空',
            'password.require'  => '密码不能为空',
            'password.max'      => '密码不能超过30个字符',
            'code.require'      => '验证码不能为空',
            'code_id.require'   => '验证码ID不能为空',
        ];

        $scene = [
            'login'       => ['user_name', 'password', 'code', 'code_id'],//登录
            'modify_pass' => ['mobile', 'password', 'platform_id', 'code'],//修改密码
            'sendSms'     => ['mobile', 'platform_id', 'sms_type'],//发送短信
        ];
        parent::__construct($rule, $message,$scene);
    }
}